#ifndef _FlashLogBuffManager_H_
#define _FlashLogBuffManager_H_

#include <stdint.h>
#include <stdlib.h>
#include "rtctime.h"
#include "flashtoeep.h"

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct
	{
		uint32_t flash_base;	
		uint32_t site_next;		
		uint32_t sits_total;	
		uint16_t sits_per_page; 
		uint16_t err;			
		uint16_t checked;		
	} log_buff_info_type;

	typedef struct
	{
		uint32_t buff_amount;										   
		uint32_t first_base;										   
		uint32_t buff_size;											   
		uint32_t page_size;											   
		uint32_t log_size;											   
		log_buff_info_type *info;									   
		void (*erase)(uint32_t addr);								   
		void (*program)(uint32_t addr, uint8_t *p_data, uint16_t Len); 
		void (*read)(uint32_t addr, uint8_t *p_data, uint16_t Len);	   
	} log_buff_cfg_type;

#ifdef __cplusplus
}
#endif

#endif
